package ApacheMathExample;

import org.apache.commons.math3.stat.descriptive.moment.*;
import org.apache.commons.math3.stat.descriptive.rank.Max;
import org.apache.commons.math3.stat.descriptive.rank.Min;
import org.apache.commons.math3.stat.descriptive.summary.Product;
import org.apache.commons.math3.stat.descriptive.summary.Sum;
import org.apache.commons.math3.stat.descriptive.summary.SumOfSquares;

public class Main {

    private static double[] values={ 0.33, 1.33,0.27333, 0.3, 0.501,
            0.444, 0.44, 0.34496, 0.33,0.3, 0.292, 0.667 };

    public static void main(String[] args) {
        Min min = new Min();
        Max max = new Max();
        Mean mean=new Mean();
        System.out.println(mean.evaluate(values));
        Product product = new Product();//乘积
        Sum sum = new Sum();
        Variance variance = new Variance();//方差
        System.out.println("min: " +min.evaluate(values));
        System.out.println("max: " +max.evaluate(values));
        System.out.println("mean: " +mean.evaluate(values));
        System.out.println("product:" + product.evaluate(values));
        System.out.println("sum: " +sum.evaluate(values));
        System.out.println("variance:" + variance.evaluate(values));


        Skewness skewness = new Skewness(); //Skewness();
        Kurtosis kurtosis = new Kurtosis(); //Kurtosis,峰度
        System.out.println("skewness:" + skewness.evaluate(values));
        System.out.println("kurtosis:" + kurtosis.evaluate(values));


    }
}
